import React, { Component } from 'react';
import '../../assets/animate.min.css'
import { CSSTransition } from 'react-transition-group';

const CartoonRoute = Cmp => {
    return class extends Component {
      render() {
        return (
          <CSSTransition
            in={this.props.match !== null}
            timeout={600}
            classNames={{
              enter: 'animate__animated',
              exit: 'animate__animated',
              enterActive: 'animate__fadeIn',
              exitActive: 'animate__fadeOut'
            }}
            unmountOnExit
          >
            <Cmp {...this.props} />
          </CSSTransition>
        )
      }
    }
  }
  export default CartoonRoute